import request from '@/utils/request'

/** 设备品牌信息*/
//品牌信息列表
export function deviceBrand(params) {
  return request({
    url: '/device-brands-api/list',
    method: 'get',
    params,
  })
}
//品牌信息新增
export function deviceBrandAdd(params) {
  return request({
    url: '/device-brands-api',
    method: 'post',
    data:params,
  })
}
//品牌信息编辑
export function deviceBrandEdit(params) {
  return request({
    url: '/device-brands-api',
    method: 'put',
    data:params
  })
}
//品牌信息删除
export function deviceBrandDel(id) {
  return request({
    url: '/device-brands-api/'+id,
    method: 'delete',
  })
}

/**设备机况信息*/
//列表
export function machineCondition(params) {
  return request({
    url: '/device-machine-condition-api/list',
    method: 'get',
    params,
  })
}
//新增
export function machineConditionAdd(params) {
  return request({
    url: '/device-machine-condition-api',
    method: 'post',
    data:params,
  })
}
//编辑
export function machineConditionEdit(params) {
  return request({
    url: '/device-machine-condition-api',
    method: 'put',
    data:params
  })
}
//删除
export function machineConditionDel(id) {
  return request({
    url: '/device-machine-condition-api/'+id,
    method: 'delete',
  })
}

/** 设备状态信息*/
//列表
export function deviceStatus(params) {
  return request({
    url: '/device-status-api',
    method: 'get',
    params,
  })
}
//新增
export function deviceStatusAdd(params) {
  return request({
    url: '/device-status-api',
    method: 'post',
    data:params,
  })
}
//编辑
export function deviceStatusEdit(params) {
  return request({
    url: '/device-status-api',
    method: 'put',
    data:params
  })
}
//删除
export function deviceStatusDel(id) {
  return request({
    url: '/device-status-api/'+id,
    method: 'delete',
  })
}


/**供应商管理*/
//列表
export function supplier(params) {
  return request({
    url: '/device/DeviceSupplier/list',
    method: 'get',
    params,
  })
}
//新增
export function supplierAdd(params) {
  return request({
    url: '/device/DeviceSupplier',
    method: 'post',
    data:params,
  })
}
//编辑
export function supplierEdit(params) {
  return request({
    url: '/device/DeviceSupplier',
    method: 'put',
    data:params
  })
}
//删除
export function supplierDel(id) {
  return request({
    url: '/device/DeviceSupplier/'+id,
    method: 'delete',
  })
}
//导出
export function supplierExport(params) {
  return request({
    url: '/device/DeviceSupplier/export',
    method: 'get',
    data:params
  })
}

/**获取设备单位信息详细数据*/
//列表
export function deviceUnits(params) {
  return request({
    url: '/system/dict/data/deviceUnits',
    method: 'get',
    params,
  })
}
/**获取设备文档类型*/
//列表
export function deviceAnnexType(params) {
  return request({
    url: '/system/dict/data/deviceAnnexType',
    method: 'get',
    params,
  })
}
/**设备文档加密级别*/
//列表
export function deviceDocumentRank(params) {
  return request({
    url: '/system/dict/data/deviceDocumentRank',
    method: 'get',
    params,
  })
}


/**删除文件*/
export function fileDelete(params) {
  return request({
    url: '/common/delete',
    method: 'POST',
    params,
  })
}
/**下载文件*/
export function fileDownload(params) {
  return request({
    url: '/common/download/resource?name='+params,
    method: 'get',
  })
}
/** 删出数据库里文件*/
export function fileDeleteLibrary(id) {
  return request({
    url: '/device/annex/by/'+id,
    method: 'delete',
  })
}
